
import axios from 'axios'


export default {
  post(url, data) {

    axios.defaults.headers['Authorization'] = 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJpZCI6NDMxLCJ1c2VybmFtZSI6IjEwNjEzOTEyMzQwIiwiaWF0IjoxNjIyNDI0MDUwLCJleHAiOjE2MjM2MzM2NTB9.2Al3-9RnKJSO6Ti5fQRZyCImdvZ9SGCl2KEjFU7EtS3yqMNGqZo-HVUk08H3mnD79xHN7XNzgvygGPldbkstRA' // 测试【新】

    return new Promise((resolve, reject) => {
      axios.post(url, data).then((res) => {
        var result = res.data
        if (result.code == 0) {
          resolve(result.data)
        }
        else {
          alert(result.msg)
          reject()
        }
      })
    })
  }
}